<html>
<head><meta charset="utf-8"><title>Using clippy in rustup linked toolchain? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html">Using clippy in rustup linked toolchain?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215587990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215587990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215587990">(Nov 04 2020 at 14:31)</a>:</h4>
<p>Hi,</p>
<p>I'd like to run clippy for my rustc fork (using a nightly clippy component isn't possible, as it won't understand the custom RUSTFLAGS we have added).</p>
<p>I have in <code>config.toml</code>:</p>
<div class="codehilite"><pre><span></span><code> [build]
 extended = true
 tools = [&quot;clippy&quot;]
</code></pre></div>
<p>Then running <code>x.py build</code> does build the cargo-clippy binary, but trying to run it using a rustup linked toolchain doesn't work:</p>
<div class="codehilite"><pre><span></span><code>$ rustup toolchain list -v
nightly-x86_64-unknown-linux-gnu (default)      /home/vext01/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu
yk-stage1 (override)    /home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1
</code></pre></div>
<div class="codehilite"><pre><span></span><code>$ cargo clippy
error: &#39;cargo-clippy&#39; is not installed for the toolchain &#39;yk-stage1&#39;
To install, run `rustup component add clippy --toolchain yk-stage1`
</code></pre></div>
<p>Am I missing something? Can it be done?</p>



<a name="215589148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215589148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215589148">(Nov 04 2020 at 14:39)</a>:</h4>
<p>FWIW, running the binary manually with a <code>LD_LIBRARY_PATH</code> set works, but shouldn't it be doable directly via a linked toolchain?</p>



<a name="215589693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215589693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215589693">(Nov 04 2020 at 14:43)</a>:</h4>
<p>Can you post the LD_LIBRARY_PATH you used? I was trying unsuccessfully to get this working.<br>
<a href="#narrow/stream/257328-clippy/topic/Run.20clippy.20in-tree">https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Run.20clippy.20in-tree</a></p>



<a name="215589910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215589910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215589910">(Nov 04 2020 at 14:45)</a>:</h4>
<p>I used:</p>
<div class="codehilite"><pre><span></span><code>LD_LIBRARY_PATH=/home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib \
    /home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/cargo-clippy
</code></pre></div>



<a name="215590071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215590071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215590071">(Nov 04 2020 at 14:46)</a>:</h4>
<p>Ah ok, it worked because you have a stage 1 build, I tried to get it working with stage 0</p>



<a name="215699619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215699619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215699619">(Nov 05 2020 at 11:33)</a>:</h4>
<p>I raised an issue for this: <a href="https://github.com/rust-lang/rustup/issues/2548">https://github.com/rust-lang/rustup/issues/2548</a></p>



<a name="215741505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Using%20clippy%20in%20rustup%20linked%20toolchain%3F/near/215741505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Using.20clippy.20in.20rustup.20linked.20toolchain.3F.html#215741505">(Nov 05 2020 at 16:58)</a>:</h4>
<p>commented on the issue</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>